{literal}
<script type="text/template" id="splitPaneTemplate">
	<table class="split-pane" border="0" cellpadding="0" cellspacing="0" >
		<tbody>
			
			<!-- Toolbar-->
			<tr class="toolbar">
				<td>
				</td>
				<td colspan="10">
					<div class="toolbar-container" id="filemanager-toolbar">
						<span class="toolbar-item">
							<div class="view listView">
								<span rel="switchView:listView"></span>
								<span rel="switchView:galleryView"></span>
							</div>
						</span>
						<span class="toolbar-item">
							<select name="filter">
								<% jQuery.each(filter, function(i,val){ %>
									<option value="<%=val.type%>"><%=val.name%></option>
								<% }); %>
							</select>
						</span>
						<span class="toolbar-item search">
							<span>Suche: </span>
							<input type="text" id="filemanager-search" class="text"/>
							<span class="search-abort" id="filemanager-search-abort-handle"></span>
							<select name="searchDir" id="search-target">
								<option value="local">in diesem Verzeichnis</option>
								<option value="root">&uuml;berall</option>
							</select>
						</span>
						
					
					</div>
				</td>
			</tr>

			<tr>
				<!-- Left drawer-->			
				<td  class="left"  valign="top" >
					<table  border="0" cellpadding="0" cellspacing="0">
						<tbody>
							<tr >
								<!-- Tree -->
								<td>
									<div class="tree" id="filemanager-tree"></div>
								</td>
							</tr>
							<tr>
								<!-- Selection list -->
								<td >
									<div class="selection-list-header" id="filemanager-selection-list-header">Gew&auml;hlte Dateien</div>
									<div class="selection-list" id="filemanager-selection-list"></div>
								</td>
							</tr>
						</tbody>
					</table>
					
				</td>

				<!-- Drag handle-->			
				<td valign="top" class="split-pane-handle" >
					<div class="split-pane-handle" id="filemanager-split-pane-handle"></div>
				</td>

				<!-- Right content-->			
				<td valign="top" class="right">
					<%if (uploadOpen || createFolder || createFile){ %>
						<div class="tabs" id="filemanager-tabs">
							<%if (uploadOpen) {%>
								<a href="#" class="tab" rel="switchTab:upload">
									<span class="icon upload" rel="switchTab:upload"></span>
									Dateien hochladen
								</a>
							<%}%>
							<%if (createFolder) {%>
								<a href="#" class="tab" rel="switchTab:newFolder">
									<span class="icon new-folder" rel="switchTab:newFolder"></span>
									Verzeichnis anlegen
								</a>
							<%}%>
							<%if (createFile) {%>
							<a href="#" class="tab" rel="switchTab:newFile">
								<span class="icon new-file" rel="switchTab:newFile"></span>
								Datei anlegen
							</a>
							<%}%>
							<span class="close" rel="closeTabs" id="filemanager-tabs-close"></span>
							<div class="tab-content" id="filemanager-tabs-content">
							</div>
						</div>
					<%}%>
					
					<div class="right" id="filemanager-split-pane-right">
					</div>
				</td>
			</tr>


		</tbody>
	</table>
	
</script>

<script type="text/template" id="treeItemsTemplate" >
<% var func, currentElements;%>
<% (function(elements, color, paddingLeft){ %> 
	
	<% func = arguments.callee; currentElements = elements;%>
	<%$.each(elements, function(i, val){ %>
		<% 
			if (val.type!='folder') return;
			val = $.extend({},elementDefaults, val); 
			val.id = 'tree-item-id-'+val.id;
		%>

		<div class="item" id="<%=val.id%>" rel="open:<%=val.id%>:<%=val.path%>:<%=val.name%>:<%=val.type%>">
			<div class="item-bg <%=color%>" style="padding-left:<%=paddingLeft%>px;" >
				<% if ( val.type == 'folder' ){ %>
					<span <%if (val.elements && val.elements.length){%>class="arrow-down"<%} else {%> class="arrow-right" <%}%> rel="toggleTree:<%=val.id%>:<%=val.path%>:<%=val.name%>"></span>
				<% } else { %>
					<span class="spacer"></span>
				<% } %>
	
				<span class="icon" rel="contextmenu" <% if (val.type) { %> style="background-image: url(<%=val.iconsRoot%><%=val.icons[val.type]%>)" <% } %> ></span>
			
				<div class="tree-name" rel="open:<%=val.id%>:<%=val.path%>:<%=val.name%>:<%=val.type%>"><%=val.name%></div>
			</div>
			<% if ( val.type == 'folder' ){ %>
				<div class="items-container" rel="<%=paddingLeft%>:<%=color%>" <%if (val.elements && val.elements.length){%>style="display: block"<%}%> >
					<% val.elements && val.elements.length && func(val.elements, color = color ? '':'grey', paddingLeft+15);%>
				</div>
			<% } %>
		</div>
	
		<% color = color ? '' : 'grey'; %>
	<% }); %> 
<% })(elements, color, paddingLeft, jQuery);%>

<!--Update current elements to last elements array -->
<% self.elements = currentElements;%>

</script>

<script type="text/template" id="selectionListTemplate" >
	<table  border="0" cellspacing="0" cellpadding="0">
		<tbody>
			<% var color = '';%>
			<%  jQuery.each(selected, function(i, val){ %>
				<tr class="<%=color%>">
					<td class="icon" <% if (val.type) { %> style="background-image: url(<%=iconsRoot%><%=icons[val.type]%>)" <% } %>></td>
					<td class="name" ><div rel="open:<%=val.id%>:<%=val.path%>:<%=val.name%>:<%=val.type%>"><%=val.name%></div></td>
					<td class="action" rel="unselect:<%=val.id%>"></td>
				</tr>
				<% color = color ? '' : 'grey'; %>
			<% }); %>
		</tbody>	
	</table>
</script>



<script type="text/template" id="newFolderTabTemplate" >
		Pfad: <span id="tabs-path"><%=path%><br /><br />
		Ordnername:<br />
		<input type="text" class="text" name="folder" id="filemanager-folder-input"/>
		<br /><br />
		<a href="#" class="button" rel="createFolder:filemanager-folder-input">Erstellen</a><a href="#" class="button" rel="closeTabs">Abbrechen</a>
</script>

<script type="text/template" id="newFileTabTemplate" >
		Pfad: <span id="tabs-path"><%=path%><br /><br />
		Dateiname:<br />
		<input type="text" class="text" name="file" id="filemanager-file-input"/>
		<br /><br />
		<a href="#" class="button" rel="createFile:filemanager-file-input">Erstellen</a><a href="#" class="button" rel="closeTabs">Abbrechen</a>
</script>

<script type="text/template" id="uploadTabTemplate" >
	Pfad: <span id="tabs-path"><%=path%><br /><br />
	<h1>Upload</h1>
	<form id="filemanager_upload_form" onsubmit="return false;">

		<div class="divFormFieldLabel">Datei(en) ausw&auml;hlen</div>
		<div class="divFormFieldInput" style="width:510px;">
			<input type="file" id="filemanager_upload_file" name="filemanager_upload_file">
		
			<br /><br />
			<input type="submit" value="Hochladen" /> <input type="submit" value="Abbrechen" rel="closeTabs"/>
		</div>

	</form>
</script>


<script type="text/template" id="listViewContainerTemplate">
	<table class="list-view header"  border="0" cellspacing="0" cellpadding="0" >
		<thead id="filemanager-list-view-header">
			<tr>
				<th class="checkbox"><input type="checkbox" rel="selectAll" id="filemanager-select-all" <% if (!multiselect){%>disabled="disabled"<%}%>/></th>
				<th rel="ls" class="icon"><span rel="ls">/..</span></th>
				<th class="name"><span rel="sort:name" <% if (sort[0]=='name'){%> class="<%=sort[1]%>" <%}%>  >Name</span></th>
				<th class="action">Aktion</th>
				<th class="size"><span rel="sort:size"  <% if (sort[0]=='size'){%> class="<%=sort[1]%>" <%}%> >Gr&ouml;sse</span></th>
				<th class="date ctime"><span rel="sort:ctime" <% if (sort[0]=='ctime'){%> class="<%=sort[1]%>" <%}%>  >Erst. Datum</span></th>
				<th class="date mtime"><span rel="sort:mtime" <% if (sort[0]=='mtime'){%> class="<%=sort[1]%>" <%}%>  >&Auml;nd. Datum</span></th>
				<th class="scrollbar-placeholder" id="filemanager-scrollbar-placeholder"></th>
			</tr>
		</thead>
	</table>
	<div class="list-view-container" id="filemanager-list-view-container">
		<table class="list-view"  border="0" cellspacing="0" cellpadding="0" >
			<tbody id="filemanager-list-view">
			</tbody>
		</table>
	</div>
</script>

<script type="text/template" id="listViewItemTemplate" >
	<% if (type == 'buffer') id='buffer_'+id; %>
	<tr class="item <%=color%>"  rel="open" id="<%=id%>">
		<td class="checkbox">
			<%if (type != 'buffer') {%>
				<input type="checkbox" rel="select:<%=id%>:<%=path%>:<%=name%>:<%=type%>" <%if (allowedSelectionType != '*' && allowedSelectionType!=type){%>disabled="disabled"<%}%>/>
			<%};%>
		</td>
		
		<td class="icon" rel="contextmenu" <% if (type) { %> style="background-image: url(<%=iconsRoot%><%=icons[type]%>)" <% } %> ></td>
	
		<td class="name" >
			<div  rel="open:<%=id%>:<%=path%>:<%=name%>:<%=type%>">
				<% if (type == 'buffer'){ %>
					Objekt <%=name%> aus der Zwischenablage hier einf&uuml;gen 
				<% } else {%>
					<%=name%>
				<% }; %>
			</div>
		</td>	
	
		<td class="action">
			<% if (type != 'buffer') {%>
				<span class="remove" rel="remove:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<span class="cut" rel="cut:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<span class="copy" rel="copy:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<%if (type == 'image'){ %>
					<span class="edit" rel="edit:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<%};%>
			<%} else{%>			
				<span class="remove" rel="remove:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
			<%};%>
		</td>	
		
		<td class="size">
			<%=size%>
		</td>

		<td class="date ctime">
			<%=ctime%>
		</td>

		<td class="date mtime">
			<%=mtime%>
		</td>		
	</tr>
</script>

<script type="text/template" id="galleryViewContainerTemplate">
	<div class="header">
		<span rel="ls" class="ls">/..</span>
		<div class="select-all">
		<input type="checkbox" rel="selectAll" id="filemanager-select-all" <% if (!multiselect){%>disabled="disabled"<%}%> />
		<label for="filemanager-select-all">Alle ausw&auml;hlen | abw&auml;hlen</label>
		</div>
	</div>
	<div id="filemanager-gallery-view-container" class="container"></div>
</script>
<script type="text/template" id="galleryViewItemTemplate">
	<div class="item-holder">
		<a class="item" id="<%=id%>" href="#">
	
			<% if ( preview ) { %>
				<div class="preview" style="background-image: url(<%=previewPath%><%=preview%>);" rel="open:<%=id%>:<%=path%>:<%=name%>:<%=type%>">
					<span class="zoom"></span>
				</div>
			<% } else { %>
				<div class="preview" >
					<div class="preview-icon" style="background-image: url(<%=iconsRoot%><%=icons[type]%>);"  rel="open:<%=id%>:<%=path%>:<%=name%>:<%=type%>">
						Keine Vorschau
					</div>
				</div>
			<% } %>
	
			<div class="description">
				<% if (descr){ %>
					<%=descr%>
				<% } else { %>
					-keine Bezeichnung-
				<% } %>
			</div>
			<input type="checkbox" class="checkbox" rel="select:<%=id%>:<%=path%>:<%=name%>:<%=type%>"  <%if (allowedSelectionType != '*' && allowedSelectionType!=type){%>disabled="disabled"<%}%>/>
			<span class="name" rel="open:<%=id%>:<%=path%>:<%=name%>"	><%=name%></span>
			<div class="footer" id="filemanager-galleryView-item-footer"></div>
			<div class="icons" id="filemanager-galleryView-item-icons">
				<span class="remove" rel="remove:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<span class="cut" rel="cut:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<span class="copy" rel="copy:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				<span class="edit first" rel="edit:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
			</div>		
		</a>
	</div>	
</script>




<script type="text/template" id="detailViewTemplate" >
	<div class="detail-view-container" id="<%=id%>">
		<a href="#" class="button" rel="switchView:<%=view%>">	
			<span class="icon" ></span>
			Zur&uuml;ck zur &Uuml;bersicht
		</a>
		<br style="clear: left;"/><br /><br />
		<div class="description">
			<label>Dateiname:</label>
			<input type="text" name="name" value="<%=name%>" class="text"/><br />
			<label>Bezeichnung:</label>
			<input type="text" name="descr" value="<%=descr%>" class="text"/><br />
			<label>Schlagworte:</label>
			<input type="text" name="keywords" value="<%=keywords%>" class="text"/>
			
			<br style="clear: left;"/><br />
			
			<label>Gr&ouml;sse:</label>
			<p><%=size%></p><br />
			<label>Bildgr&ouml;sse:</label>
			<p><%=resolution%></p><br />
			<label>Zuletzt ge&auml;ndert:</label>
			<p><%=mtime%></p><br />
			<label>Erstellt:</label>
			<p><%=ctime%></p><br />
			<label>Originaldatei:</label>
			<p><a href="<%=path%><%=name%>" target="_blank"><%=name%></a></p>
			

			<br style="clear: left;"/><br />
			
			
			<label></label>
			<a href="#" class="button" rel="saveDetails">	
				<span class="icon accept" >&nbsp;&nbsp;&nbsp;&nbsp;</span>
				Speichern
			</a>

			<br style="clear: left;"/><br /><br />
			
			<label></label>
			<input id="selection" type="checkbox" class="checkbox" rel="select:<%=id%>:<%=path%>:<%=name%>:<%=type%>"  <%if (allowedSelectionType != '*' && allowedSelectionType!=type){%>disabled="disabled"<%}%>/> 
			<label for="selection" class="selection">zur Auswahl hinzuf&uuml;gen | entfernen</label>
			<!--
			<label></label>
			<a href="#" class="button" rel="select:<%=id%>:<%=path%>:<%=name%>">	
				<span class="icon plus" >&nbsp;&nbsp;&nbsp;&nbsp;</span>
					zur Auswahl hinzuf&uuml;gen
			</a>

			<br /><br />
			<label></label>
			<a href="#" class="button" rel="unselect:<%=id%>:<%=path%>:<%=name%>">	
				<span class="icon minus" >&nbsp;&nbsp;&nbsp;&nbsp;</span>
					Auswahl entfernen
			</a>
			-->
			
			

			
		</div>
		
		<div class="item-large">
			<% if ( preview ) { %>
					<div class="preview" style="background-image: url(<%=previewPath%><%=preview%>);">
						<a href="<%=root%><%=path%><%=name%>" class="zoom" target="_blank"></a>
					</div>
					<div class="icons">
						<span class="edit first" rel="edit:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
						<span class="copy" rel="copy:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
						<span class="cut" rel="cut:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
						<span class="remove" rel="remove:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
					</div>
			<% } else { %>
				<div class="preview" >
					<div class="preview-icon" style="background-image: url(<%=iconsRoot%><%=icons[type]%>);">
						Keine Vorschau
					</div>
				</div>
				<div class="icons">
					<span class="remove" rel="remove:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
					<span class="cut" rel="cut:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
					<span class="copy" rel="copy:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
					<span class="edit first" rel="edit:<%=id%>:<%=path%>:<%=name%>:<%=type%>"></span>
				</div>
			<% } %>
		</div>
		
	</div>
</script>


			
	

<script type="text/template" id="imageEditorTemplate">
	<div class="image-editor-toolbar" id="image-editor-toolbar">
	
		<span class="item">
			<span class="icon undo" rel="undo"></span>
		</span>	

		<span class="item">
			<span class="icon rotate-left" rel="rotate:left"></span>
			<span class="icon rotate-right" rel="rotate:right"></span>
		</span>	
		<span class="item">
			<span class="icon crop-selector" rel="toggleCropper"></span>
			<select rel="ratio" name="ratio">
				<option value="3/4" selected="selected">Vordefiniertes Seitenverh&auml;ltnis</option>
				<option value="false" >Kein Seitenverh&auml;ltnis</option>
			</select>
			<a class="button crop" rel="crop" href="#">Anwenden</a>
		</span>
	
		<span class="item">
			<span class="icon zoom-minus" rel="zoom:-=10"></span>
			<div id="image-editor-slider" class="ui-slider"></div>
			<span class="icon zoom-plus" rel="zoom:+=10"></span>
		</span>	
	
	</div>
</script>

{/literal}